﻿
using Microsoft.Xna.Framework;
namespace BaoVeThanhDia.FileSetting
{
    class BangGia
    {
        int[,] banggia;
        public BangGia()
        {
            banggia = new int[19, 2]{
                                {200, 10000},
                                {185, 9500},
                                {171, 9000},
                                {157, 8500},
                                {144, 8000},
                                {124, 7500},
                                {112, 7000},
                                {101, 6500},
                                {90, 6000},
                                
                                {80, 5500},
                                {70, 5000},
                                {61, 4500},
                                {52, 4000},
                                {44, 3500},
                                {36, 3000},
                                {29, 2500},
                                {22, 2000},
                                {16, 1500},
                                {10, 1000},
                                };
        }
        public void PriceMana(int Money, int Mana)
        {
            for (int i = 0; i < 19; i++)
            {
                if (Money < banggia[i, 1]) continue;
                if (Mana < banggia[i, 0]) continue;
                MapAndUpgrade.UpgradeInterface.Gold -= banggia[i, 1];
                MapAndUpgrade.MapAndUpgrade.napxu.SubMoney(banggia[i, 1]);
                GamePage.Mana += banggia[i, 0];
                break;
            }
        }
        public Vector2 CheckAvailable(int Money, int Mana)
        {
            for (int i = 0; i < 19; i++)
            {
                if (Money < banggia[i, 1]) continue;
                if (Mana < banggia[i, 0]) continue;
                return new Vector2(banggia[i, 0], banggia[i, 1]);
            }
            return new Vector2(0, 0);
        }
    }
}
